package com.sgb.kjwl.di.device;

import com.sgb.kjwl.repository.DeviceRepertory;
import com.sgb.kjwl.repository.impl.DeviceRepertoryImpl;
import com.sgb.kjwl.view.ui.fragment.device.DeviceListFragment3;
import com.sgb.kjwl.viewmodel.device.DeviceListFragModel3;
import com.swgk.core.base.di.Fragment;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class DeviceFragModule {
    private DeviceListFragment3 deviceListFragment3;

    public DeviceFragModule(DeviceListFragment3 deviceListFragment3) {
        this.deviceListFragment3 = deviceListFragment3;
    }

    @Provides
    @Fragment
    DeviceRepertory provideDeviceRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new DeviceRepertoryImpl(apiSource, preferenceSource);
    }

    @Provides
    @Fragment
    DeviceListFragModel3 provideDeviceListFragModel3(DeviceRepertory deviceRepertory) {
        return new DeviceListFragModel3(deviceListFragment3, deviceRepertory);
    }
}

